<?php
/**
 * @link          http://cakephp.org CakePHP(tm) Project
 * @package       app.View.Layouts
 * @since         CakePHP(tm) v 0.10.0.1076
 */

$siteDescription = __d('desc_site', 'Liberalis : Bibliothèque participative.');
?>
<!DOCTYPE html>
<html>
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php echo $cakeDescription ?>:
		<?php echo $this->fetch('title'); ?>
	</title>
	<?php
		echo $this->Html->meta('icon');
		echo $this->Html->css('cake.generic');
		echo $this->Html->script('jquery-1.4.2.min');
		echo $this->Html->script('geolocalisation');
		echo $this->fetch('meta');
		echo $this->fetch('css');
		echo $this->fetch('script');
	?>
</head>
<body>
	<div id="container">
		<div id="header">
			<div id="menu_header">
				<ul>
					<li><a href="<?php echo $this->webroot; ?>"><?php echo __('Accueil'); ?></a></li>
					<li><a href="<?php echo $this->webroot; ?>editions/user_index"><?php echo __('Ma bibliothèque'); ?></a></li>
					<li><a href="<?php echo $this->webroot; ?>demandes"><?php echo __('Prêts / Emprunts'); ?></a></li>
					<li><a href="<?php echo $this->webroot; ?>editions/index"><?php echo __('Découvrir'); ?></a></li>
					<li><a href="<?php echo $this->webroot; ?>cercles"><?php echo __('Amis et cercles'); ?></a></li>
					<li><a href="<?php echo $this->webroot; ?>messages"><?php echo __('Messages'); ?></a></li>
				</ul>
			</div>
			<div id="bloc_connection">
				<?php if (!$this->Session->read('Auth.User')): ?>
					<a href="<?php echo $this->webroot; ?>utilisateurs/login"><?php echo __('Se connecter'); ?></a> / 
					<a href="<?php echo $this->webroot; ?>utilisateurs/add"><?php echo __("S'inscrire"); ?></a>
				<?php else : ?>
					<a href="<?php echo $this->webroot; ?>utilisateurs/profil"><?php echo __('Mon profil'); ?></a> / 
					<a href="<?php echo $this->webroot; ?>utilisateurs/logout"><?php echo __('Déconnexion'); ?></a>				
				<?php endif; ?>
			</div>
			<div style="clear:both;"></div>
			<div id="bloc_search">
			<?php echo $this->Form->create(null, array(
							'url' => array('controller' => 'editions', 'action' => 'index'), 'type' => 'get', 
							'id' => 'searchForm'
						)); ?>
				<?php
					echo $this->Form->input('search',array('div' => FALSE,'class'=>'search','label'=>false,'value'=>__('Rechercher titre, auteur, ISBN...'),'onfocus'=>"this.value='';"));
				?>

			<?php 
			$options = array(
				'label' => __('ok'),
				'div' => FALSE,
				'class' => 'button_search',
				// 'onclick'=>'searchBooks()'
			);
			echo $this->Form->end($options); ?>				
			</div>
			<div id="logo">
			<?php echo $this->Html->link(
					$this->Html->image('logo.png', array('alt' => $siteDescription)),
					'/',
					array('escape' => false)
				);
			?>
			</div>
		</div>
		<div id="content">

			<?php echo $this->Session->flash(); ?>

			<?php echo $this->fetch('content'); ?>
		</div>
		<div id="footer">

		</div>
	</div>
	<?php echo $this->element('sql_dump'); ?>
</body>
</html>
